package de.vogella.android.intent.implicit;

import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.Toast;

public class CallIntents extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    public void callIntent(View view){
    	Intent intent = null;
    	switch (view.getId()) {
		case R.id.Button01:
			intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://ashwinkanhere.com"));
			startActivity(intent);
			break;

		default:
			break;
		}
    }
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    	// TODO Auto-generated method stub
    	//super.onActivityResult(requestCode, resultCode, data);
    	if(resultCode == Activity.RESULT_OK && resultCode==0){
    		String result = data.toURI();
    		Toast.makeText(this, result, Toast.LENGTH_LONG);
    	}
    }
}